import React, { FC } from 'react';
import yunshi from '../../assets/img/yunshi.png';
import { Button, Space } from 'antd-mobile';
import './style.css'

interface LogRegProps {
    login: (value?: any) => void;
    register: (value?: any) => void;
    regBtnValue?: string;
    centerText?: string;
}

// 登陆注册页组件
const LogReg: FC<LogRegProps> = props => {
    const { login, register, centerText, regBtnValue} = props;
    return (
        <div className='logReg'>
            <div className='logo-title'>
                <img src={yunshi} className='logo' />
                <div className='title'>
                    <span className='yunshi'>云食</span><br />
                    <span className='center'>{centerText}</span>
                </div>
            </div>
            <div className='lrbutton'>
                <Space>
                    <Button shape='default' onClick={e => login && login()}>
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        登录
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    </Button>
                    <Button shape='default' color='primary' onClick={e => register && register()}>
                        {regBtnValue}
                    </Button>
                </Space>
            </div>
        </div>
    )
}
export default LogReg;
